package cn;

import cn.webrx.mapper.DbMapper;
import cn.webrx.wxs.mapper.StudentMapper;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class Demo {
    public static void main(String[] args) {
        try{
            var is = Resources.getResourceAsStream("mybatis-conf.xml");
            var sf = new SqlSessionFactoryBuilder().build(is);
            var ss = sf.openSession();
            //var dm = ss.getMapper(DbMapper.class);
            //System.out.println(dm.dbs());

            var sm = ss.getMapper(StudentMapper.class);
            System.out.println(sm.selectAll());
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}
